def is_prime(number):
    if number < 2:
        return False
    for i in range(2, int(number ** 0.5) + 1):
        if number % i == 0:
            return False
    return True


def find_closest_prime_number(input_string):
    number_words = input_string.split()
    number_mapping = {
        'zero': 0, 'one': 1, 'two': 2, 'three': 3,
        'four': 4, 'five': 5, 'six': 6, 'seven': 7,
        'eight': 8, 'nine': 9
    }

    if len(number_words) != 3:
        print("incorrect input")
        return

    number = int(''.join(str(number_mapping[word]) for word in number_words))

    if number < 100 or number > 999:
        print("incorrect input")
        return

    lower_prime = number
    upper_prime = number
    while True:
        if is_prime(lower_prime):
            print(lower_prime)
            return
        if is_prime(upper_prime):
            print(upper_prime)
            return
        lower_prime -= 1
        upper_prime += 1


user_input = input("enter three numbers in English: ")
find_closest_prime_number(user_input)